package ProxyDynamic;

import proxyStatic.Student;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/*
 * 项目名:    JavaProxy
 * 包名       ProxyDynamic
 * 文件名:    ProxyHandler
 * 创建者:    ZJB
 * 创建时间:  2017/10/26 on 16:17
 * 描述:     TODO
 */
public class ProxyHandler implements InvocationHandler {
    Student student;

    ProxyHandler(Student student) {
        this.student = student;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println(method.getName());
        return method.invoke(student, args);
    }
}
